﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 设计模式01
{
    /// <summary>
    /// 原型模式
    /// </summary>

    public abstract class MonkeyKingPrototype
    {
        public string Id { get; set; }

        protected MonkeyKingPrototype(string id)
        {
            Id = id;
        }

        public abstract MonkeyKingPrototype Clone();
    }

    public class ConcretePrototype : MonkeyKingPrototype
    {
        public ConcretePrototype(string id) : base(id)
        {
        }

        public override MonkeyKingPrototype Clone()
        {
            return (MonkeyKingPrototype) this.MemberwiseClone();
        }
    }
}
